﻿using ManagementCMS.Tool;
using Senparc.Weixin.MP.TenPayLibV3;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Weixin.Core.config;
using Weixin.Core.Model;

namespace Weixin.Core
{
    /// <summary>
    /// 企业付款
    /// </summary>
    public class EnterpriseTenPay
    {


        /// <summary>
        /// 
        /// </summary>
        /// <param name="small"></param>
        public static void SmallChangeTransfers(SmallChange small)
        {

            small.amount = small.amount * 100;

            TenPayV3TransfersRequestData transfer=new TenPayV3TransfersRequestData(
                WxConfig.AppId,
                WxConfig.MchId,
                small.device_info,
                WxAuxiliary.GenerateNonceStr(),
                WxAuxiliary.GenerateOutTradeNo(),
                small.openId,
                WxConfig.Key,
                small.check_name,"",
                small.amount,
                small.desc,
                IPUtils.IPRealAddress);

            var result = TenPayV3.Transfers(transfer,WxConfig.Cert,WxConfig.CertPassword);

        }


    }
}
